import os

from celery import Celery

if not os.environ.get('DJANGO_SETTINGS_MODULE'):
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meiduomall.settings.dev")

# 注册celery
celery_app = Celery('celery_tasks')
# 加载配置
celery_app.config_from_object('celery_tasks.config')

#让worker启动时自动发生有那些任务函数
celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.email', 'celery_tasks.html'])
